﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using zhangmenren.IService;
using zhangmenren.Models;
using zhangmenren.Repository;

namespace zhangmenren.Service
{
    public class CensusService:ICensusService
    {

        private CensusRepository censusRepository = new CensusRepository();

        public Task<int> Add(CensusEntity entity)
        {
            return Task.FromResult(censusRepository.Add(entity));
        }

        public Task<int> Del(int id)
        {
            return Task.FromResult(censusRepository.Del(id));
        }

        public Task<IEnumerable<CensusEntity>> FindByUserId(int id)
        {
            return Task.FromResult(censusRepository.FindByUserId(id));
        }

        public Task<IEnumerable<CensusEntity>> FindByWorkId(int id)
        {
            return Task.FromResult(censusRepository.FindByWorkId(id));
        }
    }
}
